Moving it inline to when we get the event means that we can
remove the duplicate call to _getDistanceAcrossBarrier.
https://bugzilla.gnome.org/show_bug.cgi?id=693854
this._barrierEvents = this._barrierEvents.slice(firstNewEvent);
},
- _addBarrierEvent: function(event) {
- this._barrierEvents.push(event);
- this._currentPressure += this._getDistanceAcrossBarrier(event);
- },
-
_onBarrierLeft: function(barrier, event) {
this._reset();
},
this._lastTime = event.time;
this._trimBarrierEvents();
- this._addBarrierEvent(event);
+ this._barrierEvents.push(event);
+ this._currentPressure += distance;
if (this._currentPressure >= this._threshold) {
this.emit('trigger');